home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / FireBallTrail.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.1 KB  |  46 lines

  1. class classes.fx.FireBallTrail
  2. {
  3.    var x;
  4.    var y;
  5.    var id;
  6.    var clip;
  7.    var cMax;
  8.    var xMov = 0;
  9.    var yMov = 0;
  10.    var c = 0;
  11.    var Name = "fireBallTrail";
  12.    function FireBallTrail(px, py, pid)
  13.    {
  14.       this.x = px;
  15.       this.y = py;
  16.       this.id = pid;
  17.       _root.d = _root.d + 1;
  18.       this.clip = _root.attachMovie("fireBallTrail","fireBallTrail" + this.id + "Clip",_root.d);
  19.       this.clip._x = this.x;
  20.       this.clip._y = this.y;
  21.       this.clip.gotoAndStop("shape" + _root.randRange(1,6));
  22.       if(random(2) > 0)
  23.       {
  24.          this.xMov = _root.randRange(-2,2);
  25.       }
  26.       else
  27.       {
  28.          this.yMov = _root.randRange(-2,2);
  29.       }
  30.       this.cMax = _root.randRange(8,20);
  31.    }
  32.    function main()
  33.    {
  34.       this.c = this.c + 1;
  35.       if(this.c >= this.cMax)
  36.       {
  37.          _root.removeFX("fireBallTrail" + this.id);
  38.       }
  39.       this.clip._alpha = 100 - this.c * (100 / this.cMax) + (random(50) - 25);
  40.       this.x += this.xMov;
  41.       this.y += this.yMov;
  42.       this.clip._x = this.x;
  43.       this.clip._y = this.y;
  44.    }
  45. }
  46.